#include <stdio.h>
#include "exif_handler.h"

int main(int argc, char *argv[]) {
    if (argc < 3) {
        printf("Usage: %s <image_file> <new_maker> <new_iso>\n", argv[0]);
        return 1;
    }

    const char *image_file = argv[1];
    const char *new_maker = argv[2];
    int new_iso = atoi(argv[3]);

    // Initialize EXIF handler
    if (initialize_exif_handler(image_file) != 0) {
        printf("Failed to initialize EXIF handler for %s\n", image_file);
        return 1;
    }

    // Modify Maker and ISO
    if (modify_maker(new_maker) != 0) {
        printf("Failed to modify Maker to %s\n", new_maker);
        return 1;
    }

    if (modify_iso(new_iso) != 0) {
        printf("Failed to modify ISO to %d\n", new_iso);
        return 1;
    }

    // Save changes
    if (save_exif_data() != 0) {
        printf("Failed to save EXIF data\n");
        return 1;
    }

    printf("EXIF data modified successfully.\n");
    return 0;
}